<div class="jobProviders form">
<div class="header-banner">
	<h1>
		<?php __('Job Providers');?>
		<?php //echo $this->Html->link(__('Add New', true), array('action' => 'add')); ?>
        
	</h1>
    </div>
<?php echo $this->Form->create('JobProvider', array('action' => 'save'));?>
	
	<?php
		echo $this->Form->input('JobProvider.id', array('type' => 'hidden'));
		echo $this->Form->input('JobProvider.name');
		echo $this->Form->input('JobProvider.job_location_id', array('type' => 'hidden'));
		echo $this->Form->input('JobProvider.job_location_id', array('empty'=>true, 'id' => 'parentJobLocation', 'name' => 'parent'));
		echo $this->Form->input('JobProvider.tel');
		echo $this->Form->input('JobProvider.fax');
		echo $this->Form->input('JobProvider.postal');
		echo $this->Form->input('JobProvider.email');
		echo $this->Form->input('JobProvider.web');
	?>
    <div class="clear">&nbsp;</div>
<?php echo $this->Form->end(__('Submit', true));?>
</div>

<script type="text/javascript">
	$(function(){
		var count = 0;
		$('#parentJobLocation').live('change',function(event){
			var company = $(this).attr('value');
			$('#newRow0').remove();
			$('#JobProviderJobLocationId').attr('value',company);
			if(company != ''){
				count = 1;
				$(this).closest('div').append('<div id="newRow0"></div>');	
				$('#newRow0').load(__HOST_NAME__ + '/job_locations/get_location/' + company + '/' + 1,function(){});
			}
		});
	});
</script>